﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category0
{
  public class MT074 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagSubItemDefinition U0004;
    private static SwiftTagSubItemDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagSubItemDefinition U0017;
    private static SwiftTagDefinition U0018;
    private static SwiftTagSubItemDefinition U0019;
    private static SwiftTagSubItemDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagDefinition U001C;
    private static SwiftTagSubItemDefinition U001D;
    private static SwiftTagSubItemDefinition U001E;
    private static SwiftTagSubItemDefinition U001F;
    private static SwiftTagSubItemDefinition U007F;
    private static SwiftTagSubItemDefinition U0080;
    private static SwiftTagDefinition U0081;
    private static SwiftTagSubItemDefinition U0082;
    private static SwiftTagSubItemDefinition U0083;
    private static SwiftTagSubItemDefinition U0084;
    private static SwiftTagDefinition U0086;
    private static SwiftTagSubItemDefinition U0087;

    [Description("")]
    public Tag128 BillableBIC_128
    {
      get
      {
        return new Tag128((SwiftElement) this, 0, (SwiftDefinitionElement) MT074.U0002);
      }
    }

    [Description("")]
    public Tag128 Tag128_BillableBIC
    {
      get
      {
        return this.BillableBIC_128;
      }
    }

    [Description("Region")]
    public Tag304 Region_304
    {
      get
      {
        return new Tag304((SwiftElement) this, 0, (SwiftDefinitionElement) MT074.U0008);
      }
    }

    [Description("Region")]
    public Tag304 Tag304_Region
    {
      get
      {
        return this.Region_304;
      }
    }

    [Description("")]
    public Tag129 SectionNumber_129
    {
      get
      {
        return new Tag129((SwiftElement) this, 0, (SwiftDefinitionElement) MT074.U000E);
      }
    }

    [Description("")]
    public Tag129 Tag129_SectionNumber
    {
      get
      {
        return this.SectionNumber_129;
      }
    }

    [Description("")]
    public Tag130 HeadingCode_130
    {
      get
      {
        return new Tag130((SwiftElement) this, 0, (SwiftDefinitionElement) MT074.U0011);
      }
    }

    [Description("")]
    public Tag130 Tag130_HeadingCode
    {
      get
      {
        return this.HeadingCode_130;
      }
    }

    [Description("")]
    public Tag132[] OriginalBroadcastNumber_132
    {
      get
      {
        int index = -1;
        List<Tag132> list = new List<Tag132>();
        int count;
        do
        {
          ++index;
          Tag132 tag132 = new Tag132((SwiftElement) this, index, (SwiftDefinitionElement) MT074.U0018);
          count = this.ListTags((SwiftElement) tag132).Count;
          if (count > 0)
            list.Add(tag132);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    [Description("")]
    public Tag132[] Tag132_OriginalBroadcastNumber
    {
      get
      {
        return this.OriginalBroadcastNumber_132;
      }
    }

    [Description("")]
    public Tag133[] OriginalBroadcastNumber_133
    {
      get
      {
        int index = -1;
        List<Tag133> list = new List<Tag133>();
        int count;
        do
        {
          ++index;
          Tag133 tag133 = new Tag133((SwiftElement) this, index, (SwiftDefinitionElement) MT074.U001C);
          count = this.ListTags((SwiftElement) tag133).Count;
          if (count > 0)
            list.Add(tag133);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    [Description("")]
    public Tag133[] Tag133_OriginalBroadcastNumber
    {
      get
      {
        return this.OriginalBroadcastNumber_133;
      }
    }

    [Description("")]
    public Tag134 BroadcastRequester_134
    {
      get
      {
        return new Tag134((SwiftElement) this, 0, (SwiftDefinitionElement) MT074.U0081);
      }
    }

    [Description("")]
    public Tag134 Tag134_BroadcastRequester
    {
      get
      {
        return this.BroadcastRequester_134;
      }
    }

    [Description("Broadcast Text")]
    public Tag312 BroadcastText_312
    {
      get
      {
        return new Tag312((SwiftElement) this, 0, (SwiftDefinitionElement) MT074.U0086);
      }
    }

    [Description("Broadcast Text")]
    public Tag312 Tag312_BroadcastText
    {
      get
      {
        return this.BroadcastText_312;
      }
    }

    public MT074()
      : base(true)
    {
    }

    public MT074(SwiftMessage message)
      : base(message)
    {
    }

    public Tag132 AddOriginalBroadcastNumber_132()
    {
      return new Tag132((SwiftElement) this, this.OriginalBroadcastNumber_132.Length, (SwiftDefinitionElement) MT074.U0018)
      {
        Value = string.Empty
      };
    }

    public void RemoveOriginalBroadcastNumber_132(Tag132 tag)
    {
      this.RemoveTag(tag.GetTag());
    }

    public Tag133 AddOriginalBroadcastNumber_133()
    {
      return new Tag133((SwiftElement) this, this.OriginalBroadcastNumber_133.Length, (SwiftDefinitionElement) MT074.U001C)
      {
        Value = string.Empty
      };
    }

    public void RemoveOriginalBroadcastNumber_133(Tag133 tag)
    {
      this.RemoveTag(tag.GetTag());
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT074.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT074.MessageDefinition = new SwiftMessageDefinition("MT074", "Broadcast Request");
      MT074.U0002 = new SwiftTagDefinition("BillableBIC_128", "");
      MT074.U0002.TagName = "{128:";
      MT074.U0003 = new SwiftTagSubItemDefinition("Priority", "");
      MT074.U0002.Elements.Add((SwiftDefinitionElement) MT074.U0003);
      MT074.U0004 = new SwiftTagSubItemDefinition("BankIdentifierCode", "");
      MT074.U0005 = new SwiftTagSubItemDefinition("BankCode", "");
      MT074.U0004.Elements.Add((SwiftDefinitionElement) MT074.U0005);
      MT074.U0006 = new SwiftTagSubItemDefinition("CountryCode", "");
      MT074.U0004.Elements.Add((SwiftDefinitionElement) MT074.U0006);
      MT074.U0007 = new SwiftTagSubItemDefinition("AreaCode", "");
      MT074.U0004.Elements.Add((SwiftDefinitionElement) MT074.U0007);
      MT074.U0002.Elements.Add((SwiftDefinitionElement) MT074.U0004);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U0002);
      MT074.U0008 = new SwiftTagDefinition("Region_304", "Region");
      MT074.U0008.TagName = "{304:";
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U0008);
      MT074.U000E = new SwiftTagDefinition("SectionNumber_129", "");
      MT074.U000E.TagName = "{129:";
      MT074.U000E.Mandatory = false;
      MT074.U000F = new SwiftTagSubItemDefinition("Number", "Section Number");
      MT074.U000E.Elements.Add((SwiftDefinitionElement) MT074.U000F);
      MT074.U0010 = new SwiftTagSubItemDefinition("Total", "Total Sections");
      MT074.U000E.Elements.Add((SwiftDefinitionElement) MT074.U0010);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U000E);
      MT074.U0011 = new SwiftTagDefinition("HeadingCode_130", "");
      MT074.U0011.TagName = "{130:";
      MT074.U0012 = new SwiftTagSubItemDefinition("Line1", "");
      MT074.U0013 = new SwiftTagSubItemDefinition("Code", "");
      MT074.U0012.Elements.Add((SwiftDefinitionElement) MT074.U0013);
      MT074.U0014 = new SwiftTagSubItemDefinition("Heading", "");
      MT074.U0012.Elements.Add((SwiftDefinitionElement) MT074.U0014);
      MT074.U0011.Elements.Add((SwiftDefinitionElement) MT074.U0012);
      MT074.U0015 = new SwiftTagSubItemDefinition("Line2", "");
      MT074.U0015.Mandatory = false;
      MT074.U0016 = new SwiftTagSubItemDefinition("Code", "");
      MT074.U0015.Elements.Add((SwiftDefinitionElement) MT074.U0016);
      MT074.U0017 = new SwiftTagSubItemDefinition("Heading", "");
      MT074.U0015.Elements.Add((SwiftDefinitionElement) MT074.U0017);
      MT074.U0011.Elements.Add((SwiftDefinitionElement) MT074.U0015);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U0011);
      MT074.U0018 = new SwiftTagDefinition("OriginalBroadcastNumber_132", "");
      MT074.U0018.TagName = "{132:";
      MT074.U0018.Mandatory = false;
      MT074.U0018.Multiple = true;
      MT074.U0019 = new SwiftTagSubItemDefinition("BroadcastNumber", "");
      MT074.U001A = new SwiftTagSubItemDefinition("Type", "");
      MT074.U0019.Elements.Add((SwiftDefinitionElement) MT074.U001A);
      MT074.U001B = new SwiftTagSubItemDefinition("Number", "");
      MT074.U0019.Elements.Add((SwiftDefinitionElement) MT074.U001B);
      MT074.U0018.Elements.Add((SwiftDefinitionElement) MT074.U0019);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U0018);
      MT074.U001C = new SwiftTagDefinition("OriginalBroadcastNumber_133", "");
      MT074.U001C.TagName = "{133:";
      MT074.U001C.Mandatory = false;
      MT074.U001C.Multiple = true;
      MT074.U001D = new SwiftTagSubItemDefinition("BroadcastNumber", "");
      MT074.U001E = new SwiftTagSubItemDefinition("Type", "");
      MT074.U001D.Elements.Add((SwiftDefinitionElement) MT074.U001E);
      MT074.U001F = new SwiftTagSubItemDefinition("Unsequenced", "");
      MT074.U001D.Elements.Add((SwiftDefinitionElement) MT074.U001F);
      MT074.U007F = new SwiftTagSubItemDefinition("CountryCode", "");
      MT074.U001D.Elements.Add((SwiftDefinitionElement) MT074.U007F);
      MT074.U0080 = new SwiftTagSubItemDefinition("Number", "");
      MT074.U001D.Elements.Add((SwiftDefinitionElement) MT074.U0080);
      MT074.U001C.Elements.Add((SwiftDefinitionElement) MT074.U001D);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U001C);
      MT074.U0081 = new SwiftTagDefinition("BroadcastRequester_134", "");
      MT074.U0081.TagName = "{134:";
      MT074.U0082 = new SwiftTagSubItemDefinition("BankIdentifierCode", "");
      MT074.U0081.Elements.Add((SwiftDefinitionElement) MT074.U0082);
      MT074.U0083 = new SwiftTagSubItemDefinition("RequesterName", "");
      MT074.U0081.Elements.Add((SwiftDefinitionElement) MT074.U0083);
      MT074.U0084 = new SwiftTagSubItemDefinition("RequesterCity", "");
      MT074.U0081.Elements.Add((SwiftDefinitionElement) MT074.U0084);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U0081);
      MT074.U0086 = new SwiftTagDefinition("BroadcastText_312", "Broadcast Text");
      MT074.U0086.TagName = "{312:";
      MT074.U0087 = new SwiftTagSubItemDefinition("Line", "Line");
      MT074.U0086.Elements.Add((SwiftDefinitionElement) MT074.U0087);
      MT074.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT074.U0086);
    }
  }
}
